Skip to content

Conversation

@alizada-dev
Copy link

Learners, PR Template

Self checklist

  • I have titled my PR with Region | Cohort | FirstName LastName | Sprint | Assignment Title
  • My changes meet the requirements of the task
  • I have tested my changes
  • My changes follow the style guide

Changelist

I created a new branch 'coursework/sprint-1' from the main branch and completed all the coursework in the sprint-1 folder.

@alizada-dev alizada-dev added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Feb 4, 2026
// Line 1 is a variable declaration, creating the count variable with an initial value of 0
// Describe what line 3 is doing, in particular focus on what = is doing

// Line 3 is a statement or reassignment. It is changing the value associated with the 'count' variable.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Operation like count = count + 1 is very common in programming, and there is a programming term describing such operation.

Can you find out what one-word programming term describes the operation on line 3?

const dir = ;
const ext = ;
const dir = filePath.slice(1, lastSlashIndex);
const ext = filePath.slice(lastSlashIndex + 5);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you express the statement on line 21 so that it works for any path?
For example, "/tmp/my-project/package.json"


// Math.random() * (maximum - minimum + 1) + minimum;
// Returns a random number between 1 and 100.
// The returned value is bigger than (and may possibly equal) 1 and is less than (and may possibly equal) 100;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you mean by "may possibly"? Can the expression ever evaluate to 1 and 100? Yes or No?

// Including console.log(), there are 5 function calls.

// b) Run the code and identify the line where the error is coming from - why is this error occurring? How can you fix this problem?
// The syntax error was in line 5; a comma was missing
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the function call .replaceAll(",", ""), there's a programming term for "," and "" (the values passed into the function). Could you find out what that term is so that you can more precisely describe where the comma is missing?

Comment on lines +22 to 26
// substring() method removes "3" from "399" and returns "99";
// padEnd() method pads the "99" and the padding applied is from the end of this string.
const pence = paddedPenceNumberString
.substring(paddedPenceNumberString.length - 2)
.padEnd(2, "0");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we expect this program to work as intended for any valid penceString if we deleted .padEnd(2, "0") from the code?
In other words, do we really need .padEnd(2, "0") in this script?

Comment on lines 21 to +22
What is the return value of `prompt`?
'myName No newline at end of file
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the question is asking what we can expect the function prompt() to return in general, and not what it returned when you called the function.

Answer the following questions:

What does `console` store?
It stores different data such as, debug, error, info, log, warn, and etc.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't normally refer to debug an log as data. Can you find a more appropriate term to describe them?

@cjyuan cjyuan added Reviewed Volunteer to add when completing a review with trainee action still to take. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Feb 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Reviewed Volunteer to add when completing a review with trainee action still to take.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants